#include<bits/stdc++.h>
using namespace std;

// 注意 output 格式
int main () {
    int low, up;
    cin >> low >> up;
    int sum = 0;
    for (int _ = low, i = 1; _ <= up; _++, i++) {
        sum += _;
        printf("%5d", _);
        if (i % 5 == 0) cout << endl;
    }
    if ((up - low + 1) % 5 == 0) {
        cout << "Sum = " <<  sum << endl;
    } else {
        cout << endl << "Sum = " <<  sum << endl;
    }

    return 0;
}